package StudyCode.summary.Basic;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class NewtonApproximation {
	public static void main(String arg[]) {
		double a = 2.0, x, xold;
		x = a;
		do {
			xold = x;
			x = (xold + a / xold) / 2.0;
			System.out.println(x);
		} while (Math.abs(x - xold) > 1e-10);
	}
}
